- מבחן. - 4 עבודות ב- JAVA. הגשה בזוגות דרך ה- System Submission

Similar documents
5%, 10%, 10%, 15% ע 4 Submission System-

S T R U C T U R A L M O D E L I N G ( M O D E L I N G A S Y S T E M ' S L O G I C A L S T R U C T U R E U S I N G C L A S S E S A N D C L A S S D I A

תרשים המחלקות ותרשים העצמים

CS 251 Intermediate Programming Inheritance

Object Oriented Programming: Based on slides from Skrien Chapter 2

Inheritance and Interfaces

Unified Modeling Language (UML)

Java Object Oriented Design. CSC207 Fall 2014

HAS-A Relationship. Association is a relationship where all objects have their own lifecycle and there is no owner.

System Analysis and Design. Introduction: Object Oriented Design

Tutorial 2 Today we will have a quick introduction to ArgoUML and how to use it, as well as look at some examples of class diagrams.

תוכנה 1. תרגול מספר 11: Static vs. Dynamic Binding מחלקות מקוננות Nested Classes

CS 320 Introduction to Software Engineering Spring 2017

CMPSCI 187 / Spring 2015 Hangman

Life Without NetBeans

CPSC 324 Topics in Java Programming

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

Relationships. Association Aggregation/Composition Multiplicity Dependencies

CSE 12 Abstract Syntax Trees

Today s Topic. Lecture 5. What is UML? Why Use UML. UML Diagrams. Introduction to UML. What is UML Why use UML? UML Diagrams

OO Techniques & UML Class Diagrams

HAS-A Relationship. If A uses B, then it is an aggregation, stating that B exists independently from A.

PowerPoint Slides. Object-Oriented Design Using JAVA. Chapter 2. by Dale Skrien

MARS AREA SCHOOL DISTRICT Curriculum TECHNOLOGY EDUCATION

Relationships Between Real Things. CSE 143 Java. Common Relationship Patterns. Composition: "has a" CSE143 Sp Student.

Course 3 7 March

Relationships Between Real Things CSC 143. Common Relationship Patterns. Composition: "has a" CSC Employee. Supervisor

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg

OO System Models Static Views

Chapter 4 Java Language Fundamentals

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

UML Class Diagrams Revisited

Introducing the UML Eng. Mohammed T. Abo Alroos

Eclipse Environment Setup

Practice for Chapter 11

Interview Questions I received in 2017 and 2018

Tutorial notes on. Object relational structural patterns

Javac and Eclipse tutorial

PDOM Problem Domain Object Model

C18a: Abstract Class and Method

OBJECT ORİENTATİON ENCAPSULATİON

Object-Oriented Software Engineering Practical Software Development using UML and Java

Object-Oriented Concepts and Principles (Adapted from Dr. Osman Balci)

Exercise: Singleton 1

Java Primer 1: Types, Classes and Operators

CSC207 Week 3. Larry Zhang

HAS-A Relationship. Association is a relationship where all objects have their own lifecycle and there is no owner.

abstract binary class composition diamond Error Exception executable extends friend generic hash implementation implements

Design Engineering. Dr. Marouane Kessentini Department of Computer Science

Unified Modeling Language

CS313D: ADVANCED PROGRAMMING LANGUAGE

The Final Exam Paper. Duration: 2 hours Reading: 15 minutes Total marks: 65 Hurdle: 32.5

Instance Members and Static Members

CMPSCI 187 / Spring 2015 Hanoi

Inf1-OP. Classes with Stuff in Common. Inheritance. Volker Seeker, adapting earlier version by Perdita Stevens and Ewan Klein.

Object-Oriented Systems Analysis and Design Using UML

Amortized Analysis, Union-Find,

OVERRIDING. 7/11/2015 Budditha Hettige 82

COMP 250 Fall inheritance Nov. 17, 2017

Relationships Between Real Things CSE 143. Common Relationship Patterns. Employee. Supervisor

Inf1-OP. Inheritance. Volker Seeker, adapting earlier version by Perdita Stevens and Ewan Klein. March 12, School of Informatics

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

Object Orientated Analysis and Design. Benjamin Kenwright

CMPSCI 187 / Spring 2015 Sorting Kata

Example: Count of Points

תוכנה 1 תרגול מספר 10: תרגיל חזרה חברת הייטק בית הספר למדעי המחשב אוניברסיטת תל אביב

Object-oriented basics. Object Class vs object Inheritance Overloading Interface

CS313D: ADVANCED PROGRAMMING LANGUAGE

CS111: PROGRAMMING LANGUAGE II. Lecture 1: Introduction to classes

UML IB Computer Science. Content developed by Dartford Grammar School Computer Science Department

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 5: Modelling with Classes

Creating Jar Files. Based on slides by: Jin Hung, Gregory Olds, George Blank, Sun Java Web Site

What are the characteristics of Object Oriented programming language?

Week 7. Statically-typed OO languages: C++ Closer look at subtyping

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented

CSC207 Week 4. Larry Zhang

David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation

INHERITANCE & POLYMORPHISM. INTRODUCTION IB DP Computer science Standard Level ICS3U. INTRODUCTION IB DP Computer science Standard Level ICS3U

ASSIGNMENT 5 Data Structures, Files, Exceptions, and To-Do Lists

Java: exceptions and genericity

CS107 Handout 37 Spring 2007 May 25, 2007 Introduction to Inheritance

Introduction to Java and OOP. Hendrik Speleers

Getting Started with Eclipse/Java

מבוא למדעי המחשב תרגול 8 רשימה משורשרת כללית, Comparator

Packages and Sharing Code. June 26, 2017

Lecture Contents CS313D: ADVANCED PROGRAMMING LANGUAGE

Chapter No. 2 Class modeling CO:-Sketch Class,object models using fundamental relationships Contents 2.1 Object and Class Concepts (12M) Objects,

Unified Modeling Language (UML) Class Diagram

1 Overview. 1 Overview. Contents. 1.1 Table of Contents Table of Contents

Object Oriented Methods with UML

Introduction to Java

Inheritance. Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L

ASSIGNMENT 5 Objects, Files, and More Garage Management

Modeling with UML. (1) Use Case Diagram. (2) Class Diagram. (3) Interaction Diagram. (4) State Diagram

STUDENT LESSON A20 Inheritance, Polymorphism, and Abstract Classes

C++ Programming: Introduction to C++ and OOP (Object Oriented Programming)

Advanced Object Oriented PHP

Chapter (4) Enhanced Entity-Relationship and Object Modeling

Object Orientation Fourth Story. Bok, Jong Soon

Transcription:

1

- מבחן. - 4 עבודות ב- JAVA 60% 40% הגשה בזוגות דרך ה- System Submission 2

UML Class Diagrams Packages Class Path JAR Files חלק ראשון: חלק שני: 3

An abstraction of software features A structure that singles out selected features Independent from other software elements Usually visual (diagrammatic) 4

The Unified Modeling Language (UML) is a widely accepted standard for software specification and design. It s a modeling Language. Why do engineers build models? To understand (Means for knowledge acquisition) To communicate better (Means for knowledge transfer) (תחליף - (Surrogates To predict interesting things about the system To specify the implementation of the system (Blueprints) Building models is realized by selecting statements through abstraction, i.e., reduction of information preserving properties relative to a given set of concerns. From: Bran Selic, UML2 Tutorial @ MoDELS 2012 5

+ OCL (Object Constraint Language) 6

Shows the classes of a system: Their interrelationships: Inheritance (is a) Association Aggregation (has a) [Class and Student] Composition (has a) [House and Room] Their Constraints 7

Class A group of objects (instances) that have common: Properties. Behavior. Relationships to other objects. Semantics. Information For Example: 8

Three types: Public (everyone) Protected (class, subclass and members of the same package) Private (class only) For Example: Circle - centrex:int - centrey:int + draw() # move(int X, Int Y) 9

Association is a relationship between classes which is used to show that instances of them could be either linked to each other or combined logically or physically. For example, a person works for a company: Role Person employee works for employer Company Association Name This type of association is a plain association. 10

A Student can take up to five Courses. Student has to be enrolled in at least one course. Up to 300 students can enroll in a course. A class should have at least 10 students. Student 10..300 takes 1..5 Course 11

Association VS attribute Associations are the essence of object-oriented modeling. Connections between objects are always modeled as links. Attributes provide additional (secondary) information about identified objects. Attribute heuristic rule: If it s important it s not an attribute! 12

Roles VS Objects A Person has exactly two Parents and any number of children 13

UML allows us to model other kinds of relationships between classes and objects Allows us to staticly model a realistic state of the system and makes it simpler to understand the model Generalization/SubTyping (is a) Realization Aggregation (has a) Composition (has a) 14

שעת- אוניברסיטה Inheritance relationship. With this relationship, we can collect the properties and services which are shared between some classes and extract them to a class called a SuperType Every class that was a part of this process becomes a SubType and inherits the properties, services and relationships from the SuperType class (and of course can extend them). +givepractice() עובד אוניברסיטה שם- מחלקה- ותק- +ParkTheCar() מרצה תחום מחקר- דרגה- מתרגל קבלה +givelecture() 15

דרגה- מונחה- מנחה- חברה מעסיקה טכנאים חלקם מומחים וחלקם מתמחים. לכל מתמחה יש לפחות מנחה אחד. מומחה הוא טכנאי שיודע הכל בתחום ההתמחות שלו. מתמחה יכול להיות מנחה של מתמחה אחר כל עוד אין מעגליות בתחום ההתמחות. כללים: לכל מתמחה יש רק מנחה אחד כל מומחה יכול להנחות מנחה רק בתחום אחד מהו תחום התמיכה? מנחה יכול להנחות מתמחים אחרים שיכולים להנחות אותו. יתכנו מומחה ומתמחה באותה הדרגה. מתמחה טכנאי מומחה 1 0..* 16

This relationship describes a Whole and it s Parts. Each part can only be in one Whole. It describes something and it s components. Circle Polygon Point 1 1 ספר 1 1 0..1 1..* 0..1 1 כריכה תוכן עניינים פרק אינדקס 17

This relationship is similar to Composition. It describes the relationship between the Parts of a Whole. The difference is, here the parts can be parts of another Whole. Intuitively, one can think that in composition, the Whole can t survive without one of its parts. In Aggregation, it can. קבוצה 0..* 0..* שחקן 18

A realization relationship indicates that one class implements a behavior specified by some interface An interface can be realized by many classes A class may realize many interfaces LinkedList <<interface>> List LinkedList List ArrayList 19

Name* Car * - enginesize : int - maxspeed : int Fields # getmaxspeed() : int Non Abstract Methods Abstract methods * + drive() * 20

Authorization in a relational DBMS A user may own multiple tables The owner of a table may authorize 1 or more other users access to the table An authorized user may grant more permissions. * 21

22

23

דוגמא לחברה יש בין 20 עד 120 עובדים. כל עובד מועסק בחברה אחת בלבד. ישנם 2 סוגים של עובדים: פשוט ובכיר. לכל עובד פשוט יש מנהל אחראי שהוא עובד בכיר. כל עובד בכיר יכול להיות מנהל ל 0 עד 5 עובדים פשוטים..1.2.3.4.5 24

Web based UML tool 25

Packages are the Java mechanism to prevent name collisions between classes. java.util.list java.awt.list! Package rules: Each class belongs to a package (which will hold related classes) Package may have sub-packages A package path is dot-separated foo.goo.boo Class Boo, sub-package goo, package foo Sub-packages has no special properties or privileges 26

Package declaration (In the beginning of the class) package foo.goo; class Boo {...} Or, let eclipse do it for you: Importing classes from other packages import java.util.array // Import only the Array class import java.util.*; // All classes in java.util 27

When looking for a class, the JRE looks for a.class file in directories that match the package path. Intuitively, Sub-package = Sub-directory. The root directory is the classpath. If, for example, we want to find the class foo.goo.boo in the directories tree +-classpath -... +-foo -... +-goo -X.class -Y.class -Boo.class 28

Classpath is a parameter set either on the command-line, or through an environment variable that tells the Java Virtual Machine or the Java compiler where to look for user-defined classes and packages. A classpath can contain several roots. Finding the previous class in the Classpath= A:B:C Root A +-A +-fi +-fy -Fum.class -... Root B +-B -... +-foo -... +-goo -X.class -Y.class Root C +-C -... +-foo -... +-goo -Z.class -Boo.class 29

30

Jar files are the Java equivalent to libraries and executables. A jar file is a zip archive that contains:.class files Other needed resources (images, config files) A manifest file (optional) MANIFEST.MF Source files (optional) 31

The manifest file is a text file with key:value properties. The JRE reads these properties when it loads the.jar file. Important properties in a jar manifest: Manifest-Version: For backward compatibility. (e.g Manifest-Version: 1.0) Main-Class: The class containing the main method to run. (e.g Main-Class: a.b.c.foo) Class-Path: Space-separated list of other class paths to use. (e.g Class-path: mylib1.jar mylib2.jar) See http://java.sun.com/javase/6/docs/technotes/guides/jar/ for details on jar and manifest specifications. 32

Jar files as Java shared libraries Including a jar file in a classpath will cause the JRE to look in the archive for classes and resources, as if it was another directory. Jar files as Java executables You can run a jar file by running: java -jar hello-world.jar (Or double-click on it, in some systems) The Java Runtime will load all the content of the jar, including its classpath, and will run the main class that is written in the manifest. 33

Creating a jar file using the command-line tool: jar cf <jar-file> <manifest-file> files... 34

35